package net.xiangcaowuyu.shiro.exception;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author laughing
 * @date 2020/10/12
 * @site https://www.xiangcaowuyu.net
 */
@RestControllerAdvice
public class MyAuthorizationException {

    @ExceptionHandler(UnauthorizedException.class)
    public String authorization(UnauthorizedException myAuthorizationException) {
        return "没有"+myAuthorizationException.toString()+"权限";
    }

}
